#include<iostream>
#include<cmath>
using namespace std;
int mi(int n){
    int sum=1;
    for(int i=0;i<n;i++){
        sum*=10;
    }
    return sum;
}
int For(int x){
    int sum=0;
    for(int i=8;i>-1;i--)
    {
        if(x/mi(i))
        {
            sum+=x%mi(i+1)/mi(i);
        }
    }
    return sum;
}
int While(int x){
    int sum=0,i=8;
    while(i>-1)
    {
        if(x/mi(i))
        {
            sum+=x%mi(i+1)/mi(i);
        }
        i--;
    }
    return sum;
}
int DoWhile(int x){
    int sum=0,i=8;
    do
    {
        if(x/mi(i))
        {
            sum+=x%mi(i+1)/mi(i);
        }
        i--;
    }while(i>-1);
    return sum;
}
int While1(int x){
    int sum=0,i=8;
    while(1)
    {
        if(i<0){break;}
        if(x/mi(i))
        {
            sum+=x%mi(i+1)/mi(i);
        }
        i--;
    }
    return sum;
}
void Prime(){
    int sum=1;
    cout<<2<<"  ";
    for(int i=3;i<=1000;i+=2){
        int flag=1;
        for(int j=3;j<i&&flag;j+=2)
        {
           if(i%j==0){flag=0;}
        }
        if(flag==0){continue;}
        sum=(sum+1)%5;
        if(sum){
                cout<<i<<"  ";
            }
        else{
                cout<<i<<endl;
            }

    }
}
int main(){
    Prime();
    int x;
    cin>>x;
    cout<<"for:"<<For(x)<<"  while:"<<While(x)<<"  do while:"<<DoWhile(x)<<"  while(1):"<<While1(x)<<endl;


}
